/**
 * @date 2006-7-18
 */

package org.nanhill.xmlro.gsp;

import java.io.IOException;
import java.util.HashMap;
import java.util.Map;

import org.nanhill.xmlro.gsp.client.DefaultGspAgent;
import org.nanhill.xmlro.gsp.client.GspAgent;

/**
 * @author alin [xalinx at gmail dot com]
 * @date 2006-7-18
 */
public class InsertClassSample {

	private static long getRetcode(Map result) {
		Map map = (Map) result;
		return (Long) map.get("retcode");
	}

	/**
	 * @param args
	 * @throws GspException
	 * @throws GspException
	 * @throws IOException
	 */
	public static void main(String[] args) throws GspException, IOException {
		// create agent bind with sls module name
		GspAgent importAgent = new DefaultGspAgent("hawaii.kernel.sls");
		importAgent.addSLSTarget("192.168.3.9", 2001);
		// set gsp service name and version
		importAgent.setServiceType("centaurus.dbservice", "1");
		importAgent.locate();

		// TODO Auto-generated method stub
		Map<String, Object> option = new HashMap<String, Object>();
		option.put("parentId", 24L);
		option.put("name", "alin");
		option.put("alias", "alin");
		importAgent.doService("insertClass", option);
		importAgent.close();

	}

}
